package com.htu.model.impl;

import com.htu.domain.User;
import com.htu.model.IUserModel;
import com.htu.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class UserModelImpl implements IUserModel
{
    @Autowired
    private IUserService service;

    @Override
    public User doLogin(int id, String password)
    {
        return service.doLogin(id, password);
    }

    @Override
    public User doLoginById(int id)
    {
        return service.doLoginById(id);
    }

    @Override
    public boolean doUpdatePassword(int id, String password)
    {
        return service.doUpdatePassword(id, password);
    }

    @Override
    public boolean doUpdateUser(User user)
    {
        return service.doUpdateUser(user);
    }

    @Override
    public List<User> queryUserAll()
    {
        return service.queryUserAll();
    }

    @Override
    public boolean doRegister(User user)
    {
        return service.doRegister(user);
    }

}
